/**************************************************************************
 * $RCSfile: DefaultMetaComponentObject.java,v $  $Revision: 1.3 $  $Date: 2009/05/21 07:33:50 $
 *
 * $Log: DefaultMetaComponentObject.java,v $
 * Revision 1.3  2009/05/21 07:33:50  @author simplefan
 * *** empty log message ***
 *
 * Revision 1.2  2008/12/31 04:44:41  @author simplefan
 * *** empty log message ***
 *
 * Revision 1.1  2008/12/26 05:55:23  @author simplefan
 * *** empty log message ***
 *
 **************************************************************************/
/*
 * Copyright 2008 gxlu, Inc. All rights reserved.
 * File name : DefaultMetaComponentObject.java
 * Created on : Dec 25, 2008 7:43:57 PM
 * Creator : @author simplefanJin
 */
package com.simplefan.meta.cfg;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.simplefan.meta.MetaAttribute;
import com.simplefan.meta.MetaComponent;
import com.simplefan.meta.MetaComponentObject;

/**
 * @author @author simplefanJin
 */
public class DefaultMetaComponentObject extends DefaultMetaData implements MetaComponentObject, Cloneable {

  private static final long serialVersionUID = 4993724155556971250L;

  public DefaultMetaComponentObject(MetaComponent metaComponent){
    super();
    this.metaComponent = metaComponent;
  }

  @Override
  public List<MetaAttribute> getAttributeList() {

    return metaComponent.getMetaAttributes();
  }

  public MetaComponent getMetaComponent() {
    return this.metaComponent;
  }

  private MetaComponent metaComponent;

  @Override
  public Object clone() throws CloneNotSupportedException {
    DefaultMetaComponentObject clone = (DefaultMetaComponentObject)super.clone();

    Map<String, Object> mapsClone = null;
    if(getMaps() != null) {
      mapsClone = new HashMap<String, Object>();
      mapsClone.putAll(getMaps());
    }
    clone.setMaps(mapsClone);
    return clone;
  }
}
